package com.wkbb.basic.smartschool.bean;

/**
 * @author Lilin
 */
public class WitCampusResult<T> {

    private static final int REQUEST_SUCCESS = 0;

    /**
     * msg : 成功
     * datetime : 8.113037109375 ms
     * code : 0
     * data : {"name":" 微看宝宝智慧校园","logo":"http://p.qpic.cn/smartcampus/0/857292533331557/145","edu_type":"1"}
     */

    private String msg;
    private String datetime;
    private Integer code;
    private T data;

    public WitCampusResult<T> error() {
        this.code = 1000001;
        this.msg = "请求智慧校园接口发生异常";
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getDatetime() {
        return datetime;
    }

    public void setDatetime(String datetime) {
        this.datetime = datetime;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public boolean isSuccess() {
        return code == REQUEST_SUCCESS;
    }
}
